package vip.sujianfeng.enjoyapi.po.demo

import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import vip.sujianfeng.enjoydao.annotations.*
import vip.sujianfeng.enjoydao.sqlcondition.*
import vip.sujianfeng.enjoydao.enums.*

/**
 * author GenerateModelBuilder
 * description 读取数据库生成的实体模型代码，不要手动修改，重新生成后会覆盖
 **/
@ApiModel("学生信息PO")
@TbTableUuid(table = "demo_student")
open class DemoStudentPO: vip.sujianfeng.enjoyapi.dbconn.MyModelBase() {
    @ApiModelProperty("地址")
    @TbFieldString(tableField = "address", label = "地址", length = 200)
    var address: String? = null
    @ApiModelProperty("年龄")
    @TbFieldInt(tableField = "age", label = "年龄")
    var age: Int? = null
    @ApiModelProperty("班级ID")
    @TbFieldString(tableField = "class_id", label = "班级ID", length = 50)
    var classId: String? = null
    @ApiModelProperty("邮箱")
    @TbFieldString(tableField = "email", label = "邮箱", length = 100)
    var email: String? = null
    @ApiModelProperty("性别")
    @TbFieldString(tableField = "gender", label = "性别", length = 10)
    var gender: String? = null
    @ApiModelProperty("学生姓名")
    @TbFieldString(tableField = "name", label = "学生姓名", length = 50)
    var name: String? = null
    @ApiModelProperty("电话")
    @TbFieldString(tableField = "phone", label = "电话", length = 20)
    var phone: String? = null

    companion object {
        const val TABLE_NAME = "demo_student"
        const val ADDRESS = "address"
        const val AGE = "age"
        const val BIZ_STATUS = "biz_status"
        const val CLASS_ID = "class_id"
        const val CREATE_TIME = "create_time"
        const val CREATE_USER_ID = "create_user_id"
        const val EMAIL = "email"
        const val GENDER = "gender"
        const val ID = "id"
        const val NAME = "name"
        const val PHONE = "phone"
        const val REMARK = "remark"
        const val STATE = "state"
        const val UPDATE_TIME = "update_time"
        const val UPDATE_USER_ID = "update_user_id"
    }
}

/**
 * author GenerateModelBuilder
 * description Sql条件生成器
 **/
class DemoStudentCU: SqlConditionBuilder<DemoStudentCU>() {
    var ADDRESS = SqlConditionField<DemoStudentCU>(this, "a.address")
    var AGE = SqlConditionField<DemoStudentCU>(this, "a.age")
    var BIZ_STATUS = SqlConditionField<DemoStudentCU>(this, "a.biz_status")
    var CLASS_ID = SqlConditionField<DemoStudentCU>(this, "a.class_id")
    var CREATE_TIME = SqlConditionField<DemoStudentCU>(this, "a.create_time")
    var CREATE_USER_ID = SqlConditionField<DemoStudentCU>(this, "a.create_user_id")
    var EMAIL = SqlConditionField<DemoStudentCU>(this, "a.email")
    var GENDER = SqlConditionField<DemoStudentCU>(this, "a.gender")
    var ID = SqlConditionField<DemoStudentCU>(this, "a.id")
    var NAME = SqlConditionField<DemoStudentCU>(this, "a.name")
    var PHONE = SqlConditionField<DemoStudentCU>(this, "a.phone")
    var REMARK = SqlConditionField<DemoStudentCU>(this, "a.remark")
    var STATE = SqlConditionField<DemoStudentCU>(this, "a.state")
    var UPDATE_TIME = SqlConditionField<DemoStudentCU>(this, "a.update_time")
    var UPDATE_USER_ID = SqlConditionField<DemoStudentCU>(this, "a.update_user_id")
}
